package cn.lecosa.spark.mysql

import java.util.ResourceBundle
import java.util.Locale
import java.util.Properties
import java.io.FileInputStream
import java.io.BufferedInputStream
import java.io.InputStream
import java.sql.DriverManager
import java.sql.Connection

object Test {
   def main(args: Array[String]) {  
    
    var connection:Connection = JdbcUtil.getConn()  
   
    try {  
      val statement = connection.createStatement()  
      val resultSet = statement.executeQuery(" SELECT *  from student")  
      
      while ( resultSet.next() ) {  
        val id = resultSet.getString("id")  
        val typeid = resultSet.getString("name")  
        println("id, typeid = " + id + ", " + typeid)  
      }  
    } catch  {  
       case e: Throwable => e.printStackTrace
       //case _: Throwable => println("ERROR")  
    }  
    
    JdbcUtil.releaseCon(connection)
  } 
}